<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>p4_元素溢出替换为省略号</title>
  <style>
    div{
      background-color: yellow;
      width: 200px;/*想溢出必须先设置区域大小*/
        /*组合代码 以下三句缺一不可*/
      white-space: nowrap;/*强制不换行*/
      overflow: hidden;/*溢出文字隐藏*/
      text-overflow: ellipsis;/*将溢出的文字替换为省略号*/

    }
  </style>
</head>
<body>
<div>
  Lorem ipsum dolor sit amet, consectetur adipisicing elit. Animi aperiam, assumenda at, consequuntur, deleniti dignissimos dolorum ea enim ex harum impedit itaque nemo porro quaerat quisquam reprehenderit sequi soluta vero?
</div>
</body>
</html>